package com.financial.gateway.constants;

/**
 * @Author WANGNING
 * @Email wyn20140226@aliyun.com
 * @Description //请求网关路由配置
 * @Date 2020/1/3 15:57
 */
public enum FinancialRoutePahtConstants {
    /*
     * 银盛报备路由
     *
     * */
    YS_REPORT("101") {
        @Override
        String routerConverter() {
            return "/ys/ys/report";
        }
    },

    /*
     * 银盛支付路由
     *
     * */
    YS_PAY("102") {
        @Override
        String routerConverter() {
            return "/ys/ys/pay";
        }
    },

    /*
     * 银盛分账路由
     *
     * */
    YS_SPLIT("103") {
        @Override
        String routerConverter() {
            return "/ys/ys/split";
        }
    },

    /*
     * 银盛退款路由
     *
     * */
    YS_REFUND("104") {
        @Override
        String routerConverter() {
            return "/ys/ys/refund";
        }
    },

    /*
     * 银盛提现路由
     *
     * */
    YS_WITHDRAWAL("105") {
        @Override
        String routerConverter() {
            return "/ys/ys/withdrawal";
        }
    },

    /*
     * 银盛代付路由
     *
     * */
    YS_PAYMENT("106") {
        @Override
        String routerConverter() {
            return "/ys/ys/payment";
        }
    },

    /*
     * 银盛查询路由
     *
     * */
    YS_QUERY("107") {
        @Override
        String routerConverter() {
            return "/ys/ys/query";
        }
    },

    /*
     * 汇收银报备路由
     *
     * */
    HEEMONEY_REPORT("201") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/report";
        }
    },

    /*
     * 汇收银支付路由
     *
     * */
    HEEMONEY_PAY("202") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/pay";
        }
    },

    /*
     * 汇收银分账路由
     *
     * */
    HEEMONEY_SPLIT("203") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/split";
        }
    },

    /*
     * 汇收银退款路由
     *
     * */
    HEEMONEY_REFUND("204") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/refund";
        }
    },

    /*
     * 汇收银提现路由
     *
     * */
    HEEMONEY_WITHDRAWAL("205") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/withdrawal";
        }
    },

    /*
     * 汇收银代付路由
     *
     * */
    HEEMONEY_PAYMENT("206") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/payment";
        }
    },

    /*
     * 汇收银查询路由
     *
     * */
    HEEMONEY_QUERY("207") {
        @Override
        String routerConverter() {
            return "/heemoney/heemoney/query";
        }
    },

    /*
     * 够样余额支付路由
     *
     * */
    BALANCE_PAY("301") {
        @Override
        String routerConverter() {
            return "/balance/balance/pay";
        }
    },

    /*
     * 够样余额退款路由
     *
     * */
    BALANCE_REPORT("302") {
        @Override
        String routerConverter() {
            return "/balance/balance/refund";
        }
    },

    /*
     * 够样余额代付路由
     *
     * */
    BALANCE_PAYMENT("303") {
        @Override
        String routerConverter() {
            return "/balance/balance/payment";
        }
    },

    /*
     * 够样余额查询路由
     *
     * */
    BALANCE_QUERY("304") {
        @Override
        String routerConverter() {
            return "/balance/balance/query";
        }
    },

    /*
     * 优店积分支付路由
     *
     * */
    INTEGRAL_PAY("401") {
        @Override
        String routerConverter() {
            return "/integral/integral/pay";
        }
    },

    /*
     * 优店积分退款路由
     *
     * */
    INTEGRAL_REFUND("402") {
        @Override
        String routerConverter() {
            return "/integral/integral/refund";
        }
    },

    /*
     * 优店积分代付路由
     *
     * */
    INTEGRAL_PAYMENT("403") {
        @Override
        String routerConverter() {
            return "/integral/integral/payment";
        }
    },

    /*
     * 优店积分查询路由
     *
     * */
    INTEGRAL_QUERY("404") {
        @Override
        String routerConverter() {
            return "/integral/integral/query";
        }
    },

    /*
     * 获取accesstoken路由
     *
     * */
    TOKEN_GETACCESSTOKEN("501") {
        @Override
        String routerConverter() {
            return "/token/authorityConfig/getAccessToken";
        }
    };

    abstract String routerConverter();

    /**
     * 业务类型
     */
    private String business_type;

    FinancialRoutePahtConstants(String business_type) {
        this.business_type = business_type;
    }

    public String getBusiness_type() {
        return business_type;
    }

    public static String routePath(String business_type) {
        String routePath = null;
        for (FinancialRoutePahtConstants financialRoutePahtConstants : FinancialRoutePahtConstants.values()) {
            if (financialRoutePahtConstants.getBusiness_type().equals(business_type)) {
                routePath = financialRoutePahtConstants.routerConverter();
                return routePath;
            }
        }
        return routePath;
    }

    public static void main(String[] args) {
        System.out.println(FinancialRoutePahtConstants.routePath("101"));
    }
}
